<template>
	<view>
		<view class="header">
			<view class="navbar" :style="{height: systemBarHeight + 'px'}">
			</view>
			<view class="navbar">
				<uni-nav-bar @clickLeft="fh" :border="false" left-icon="left" title="消息" />
			</view>

			<!-- type -->
			<view class="msgtype">
				<view class="msgtype_item">
					<image src="/static/mine/pinglun.png" mode=""></image>
					<text>评论回复</text>
				</view>
				<view class="msgtype_item">
					<image src="/static/mine/dianzan.png" mode=""></image>
					<text>收到点赞</text>
				</view>
			</view>
		</view>
		<view class="heng">

		</view>


		<view class="message">
			<view class="message_tit">
				<text>信息</text>
			</view>

			<view class="message_item" v-for="(item,index) in messageList" :key="index">
				<view class="message_item_lf">
					<image src="/static/logo.png" mode=""></image>
				</view>
				<view class="message_item_rg">
					<view class="message_item_rg_tit">
						<view class="message_item_rg_tit1">
							<text>{{item.username}}</text>
							<view class="zuozhe" v-if="item.identity==false">
								<text>作者</text>
							</view>
						</view>
						<view class="message_item_rg_tit2">
							<text>1小时前</text>
						</view>
					</view>

					<view class="message_item_rg_meg">
						<text>{{item.message}}</text>
					</view>
				</view>
			</view>
		</view>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				systemBarHeight: 0,
				messageList: [{
						username: '用户ABCS',
						message: '（建议收）的蓝调雪中稚内的蓝调时刻雪中稚内…',
						identity: false
					},
					{
						username: '用户ABCS',
						message: '（建议收）的蓝调雪中稚内的蓝调时刻雪中稚内…',
						identity: true
					},
					{
						username: '用户ABCS',
						message: '用户ABS给你点了个攒',
						identity: true
					}
				]
			}
		},
		mounted() {
			this.getSysteminfo()
		},
		methods: {
			/* 手机顶部高度 */
			getSysteminfo() {
				uni.getSystemInfo({
					success: res => {
						this.systemBarHeight = res.statusBarHeight;
					}
				});
			},
			/* 返回 */
			fh() {
				uni.navigateBack({
					delta: 1 // 返回的页面层级，1表示返回上一页
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.header {

		padding-bottom: 61rpx;
	}

	.msgtype {
		display: flex;
		width: 80%;
		margin: 50rpx auto 0;


		.msgtype_item {
			display: flex;
			flex-direction: column;
			margin: auto;

			>image {
				width: 110.69rpx;
				height: 114.5rpx;
			}

			>text {
				font-family: PingFang SC, PingFang SC;
				font-weight: 500;
				font-size: 27rpx;
				color: #152034;
			}
		}
	}

	.heng {
		width: 750rpx;
		height: 15rpx;
		background: #F4F6F9;
		border-radius: 0rpx 0rpx 0rpx 0rpx;
	}

	.message {
		.message_tit {
			padding-top: 30rpx;
			width: 91%;
			margin: auto;
			font-family: PingFang SC, PingFang SC;
			font-weight: 500;
			font-size: 31rpx;
			color: #152034;
		}

		.message_item {
			width: 91%;
			margin: 30rpx auto 0;
			display: flex;
			align-items: center;
			padding-bottom: 30rpx;
			border-bottom: 1rpx solid rgba(0, 0, 0, 0.1);

			.message_item_lf {
				>image {
					width: 65rpx;
					height: 65rpx;
					border-radius: 32.5rpx;
				}
			}

			.message_item_rg {
				margin-left: 10rpx;
				width: 100%;

				.message_item_rg_tit {
					display: flex;
					align-items: center;

					.message_item_rg_tit1 {
						font-family: PingFang SC, PingFang SC;
						font-weight: 500;
						font-size: 27rpx;
						color: #152034;
						display: flex;
						align-items: center;
						justify-content: space-between;

						.zuozhe {
							width: 69rpx;
							height: 32rpx;
							background: #FFFFFF;
							border-radius: 8rpx 8rpx 8rpx 8rpx;
							border: 1rpx solid #7D8CA4;
							display: flex;
							align-content: center;
							justify-content: center;
							font-family: PingFang SC, PingFang SC;
							font-weight: 400;
							font-size: 23rpx;
							color: #7D8CA4;
							margin-left: 15rpx;
						}
					}

					.message_item_rg_tit2 {
						font-family: PingFang SC, PingFang SC;
						font-weight: 400;
						font-size: 23rpx;
						color: #7D8CA4;
						margin-left: auto;
					}
				}

				.message_item_rg_meg {
					font-family: PingFang SC, PingFang SC;
					font-weight: 400;
					font-size: 27rpx;
					color: #152034;
					margin-top: 7rpx;
				}
			}

		}
	}
</style>